package com.freesky.biz.icbc.controller;

import com.freesky.biz.icbc.domain.TEquityReceive;
import com.freesky.biz.icbc.domain.TSpecialRecord;
import com.freesky.biz.icbc.service.IEquityReceiveService;
import com.freesky.biz.icbc.service.ISpecialRecordService;
import com.freesky.common.annotation.Log;
import com.freesky.common.core.controller.BaseController;
import com.freesky.common.core.domain.AjaxResult;
import com.freesky.common.core.page.TableDataInfo;
import com.freesky.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 工行存管业务
 */
@RestController
@RequestMapping("/icbc/equity/receive")
public class EquityReceiveController extends BaseController {

    @Autowired
    private IEquityReceiveService equityReceiveService;

    /**
     * 特色卡活动列表
     */
    @PreAuthorize("@ss.hasPermi('icbc:equityreceive:list')")
    @GetMapping("/list")
    public TableDataInfo list(TEquityReceive equityReceive) {
        startPage();
        List<TEquityReceive> list = equityReceiveService.findList(equityReceive);
        return getDataTable(list);
    }

    @Log(title = "工行存管", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('icbc:equityreceive:export')")
    @GetMapping("/export")
    public AjaxResult export(TEquityReceive equityReceive,
                             HttpServletResponse response) {
        return equityReceiveService.exportFile(equityReceive);
    }

}
